//
//  QXConfiguration.m
//  Pods
//
//  Created by Qianxia on 2016/12/29.
//
//

#import "QXConfiguration.h"
#import <QXUtils/QXUtils-umbrella.h>


/// 应用Id，由服务器分配
NSString * const QXAppId = @"9dd58b6d5f64a22d00c3f6264f8ce597";

/// 请求key，由服务器分配
NSString * const QXRequestKey = @"fffa2a879e62e198924a95dc150dc33823bd0bf7abd3a20fff605f297ae9333804699723a6219048";

/// 用户Token Key
NSString * const QXUserTokenKey = @"com.qianxx.user.token";

/// 用户UUID
NSString * const QXUserUUIDKey = @"com.qianxx.user.uuid";

/// 用户所在的城市
NSString * const QXUserCityKey = @"com.qianxx.user.city";

/// 第一次启动应用
NSString * const QXFirstLaunchKey = @"com.qianxx.user.isFirstLaunch";

/// 高德地图Key
NSString * const AMap_AppKey = @"a29e9158061c2b426afadb9622c0d8d6";

/// 友盟APPKey
NSString * const UMENG_APPKEY = @"587b3c28310c9364ec000a9d";

/// 极光推送证书
NSString * const JPush_AppKey = @"063edd39e3708d2ed236f044";

NSString * const QXAppName = @"约约出行";

NSString * const QXHome_MapViewCenterImageView_Hidden_NotificationKey = @"QXHome_MapViewCenterImageView_Hidden_NotificationKey";

NSString * const QXHome_MenuView_Hidden_NotificationKey = @"QXHome_MenuView_Hidden_NotificationKey";

NSString * const QXHome_TitleText_NotificationKey = @"QXHome_TitleText_NotificationKey";

NSString * const QXHome_BackAction_NotificationKey = @"QXHome_BackAction_NotificationKey";

/// 切换业务类型
NSString * const QXHome_BusinessType_Change_NotificationKey = @"QXHome_BusinessType_Change_NotificationKey";


#pragma mark - 订单状态
//新建订单
NSInteger const ORDER_MAIN_STATUS_INITIAL = 1;
//订单进行中
NSInteger const ORDER_MAIN_STATUS_DOING = 2;
//行程结束、待支付
NSInteger const ORDER_MAIN_STATUS_DONE = 3;
//支付完成、订单结束
NSInteger const ORDER_MAIN_STATUS_PAYED = 4;
//订单取消（完结）
NSInteger const ORDER_MAIN_STATUS_CANCEL = 5;

#pragma mark - 订单子状态
NSInteger const WAIT_REPLY = 100; // 乘客发单、等待应答

NSInteger const WAIT_BEGIN_APPOINTMENT = 200; // 等待接驾－预约订单
NSInteger const WAIT_ARRIVE_ORIGIN = 210; // 等待接驾-已出发未到达"上车地点"
NSInteger const WATI_PASSENGER_GET_ON = 220; // 等待接驾-已到达"上车地点"
NSInteger const DEPART = 300; // 行程开始

NSInteger const ARRIVE_DEST = 400; // 到达目的地
NSInteger const FARE_CONFIRM = 500; // 司机确认费用，等待乘客支付 //TODO
NSInteger const CANCEL_BY_PASSENGER_NEED_PAY = 510; //乘客取消订单，待支付取消费用（有取消费用的情况） //TODO

NSInteger const COMPLETE_WITHOUT_EVALUATE = 600; // 已完成，待评价
NSInteger const COMPLETE = 610; // 已完成，已评价

NSInteger const CANCEL_BEFORE_ACCEPT = 900; // 应答前取消订单（乘客）
NSInteger const CANCEL_BY_PASSENGER_BEFORE_ARRIVE_START = 901; // 乘客取消（行程确定后、司机未到达） //TODO
NSInteger const CANCEL_BY_PASSENGER_AFTER_ARRIVE_START = 902; // 乘客取消（行程确定后、司机到达） //TODO
NSInteger const CANCEL_BY_DRIVER = 910; // 司机取消订单
NSInteger const CANCEL_BY_SYSTEM = 990; // 后台取消
NSInteger const CANCEL_NO_ANSWER = 980; // 无人抢单，订单超时

/* 拼车订单，增加状态 */
NSInteger const CARPOOL_PUBLISH_BY_DRIVER = 101; //司机发单、拼车中
NSInteger const CARPOOL_NOT_FULL = 201; //司机拼车中（不满员）
NSInteger const CARPOOL_FULL = 202; //司机拼车中（满员）

/* 跨城拼车，订单状态变化 */
// 101(司机发单、拼车中) -> 210(行程开始、未接到所有乘客) -> 300(接到所有乘客、未将所有乘客送达目的地) -> 600(所有乘客送达，已完成)


@implementation QXConfiguration

/**
 主色调
 
 @return #3E88F5
 */
+ (nullable UIColor *)mainColor {
    
    return [UIColor colorWithHexString:@"3E88F5"];
}


/**
 起点颜色
 
 @return #F99358
 */
+ (nullable UIColor *)originColor {
    
    return [UIColor colorWithHexString:@"F99358"];
}

/**
 终点颜色
 
 @return #22CEDB
 */
+ (nullable UIColor *)destinationColor {
    
    return [UIColor colorWithHexString:@"22CEDB"];
}

/**
 字体色
 
 @return #4F5A67
 */
+ (nullable UIColor *)fontColor {
    
    return [UIColor colorWithHexString:@"4F5A67"];
}

/**
 子标题字体色
 
 @return #9EA7B1
 */
+ (nullable UIColor *)subFontColor {
    
    return [UIColor colorWithHexString:@"9EA7B1"];
}


/**
 占位符颜色
 
 @return #D0D5D9
 */
+ (nullable UIColor *)placeholderColor {
    
    return [UIColor colorWithHexString:@"D0D5D9"];
}

/**
 分割线颜色
 
 @return #E4E7EA
 */
+ (nullable UIColor *)dividingLineColor {
    
    return [UIColor colorWithHexString:@"E4E7EA"];
}

/**
 背景颜色
 
 @return #F3F4F6
 */
+ (nullable UIColor *)backgroundColor {
    
    return [UIColor colorWithHexString:@"F3F4F6"];
}


/**
 按钮颜色
 
 @return #4F5A67
 */
+ (nullable UIColor *)buttonColor {
    
    return [UIColor colorWithHexString:@"4F5A67"];
}

/**
 按钮点击颜色
 
 @return #3F4A57
 */
+ (nullable UIColor *)buttonHighlightedColor {
    
    return [UIColor colorWithHexString:@"3F4A57"];
}

/**
 按钮第二个颜色
 
 @return #F99358
 */
+ (nullable UIColor *)buttonSecondColor {
    
    return [UIColor colorWithHexString:@"F99358"];
}

/**
 按钮第二个点击颜色
 
 @return #F28445
 */
+ (nullable UIColor *)buttonSecondHighlightedColor {
    
    return [UIColor colorWithHexString:@"F28445"];
}

#pragma mark - 主机

/**
 主机地址如 www.baidu.com
 
 @return 主机地址
 */
+ (NSString *)apiBaseUrlString {
    return @"https://api.yueyuechuxing.cn";
}

/**
 长连接
 
 @return 长连接
 */
+ (NSString *)socketBaseUrlString {
    return @"ws://120.24.42.51:9999";
}

#pragma mark - 资源

/**
 获取图片
 
 @param imageName 图片名称
 @return 图片
 */
+ (UIImage *)imageWithName:(NSString *)name {
    
    NSBundle *podBundle = [NSBundle bundleForClass:[self class]];
    NSURL *bundleURL = [podBundle URLForResource:@"QXConfiguration" withExtension:@"bundle"];
    UIImage *image = [UIImage imageNamed:name inBundle:[NSBundle bundleWithURL:bundleURL] compatibleWithTraitCollection:nil];
    
    return image;
}


@end
